// 分页定义
export const pagination = {
  pageIndex: 1,
  pageSize: 20,
  total: 0
}

// 表格样式
export const tableoption = {
  tableStripe: true, // 是否斑马栏
  tableBorder: true // 单元格右边边框
}
export const rssiList = [
  {
    default: -127,
    stable: -127,
    label: '默认'
  },
  {
    default: -40,
    stable: -34,
    label: -40
  },
  {
    default: -51,
    stable: -45,
    label: 0.5
  },
  {
    default: -60,
    stable: -54,
    label: 1
  },
  {
    default: -63,
    stable: -55,
    label: 2
  },
  {
    default: -66,
    stable: -58,
    label: 3
  },
  {
    default: -68,
    stable: -60,
    label: 4
  },
  {
    default: -70,
    stable: -62,
    label: 5
  },
  {
    default: -72,
    stable: -64,
    label: 6
  },
  {
    default: -74,
    stable: -66,
    label: 7
  },
  {
    default: -76,
    stable: -68,
    label: 8
  },
  {
    default: -78,
    stable: -70,
    label: 9
  },
  {
    default: -80,
    stable: -72,
    label: 10
  },
  {
    default: -82,
    stable: -74,
    label: 11
  },
  {
    default: -84,
    stable: -76,
    label: 12
  },
  {
    default: -86,
    stable: -78,
    label: 13
  },
  {
    default: -88,
    stable: -80,
    label: 14
  },
  {
    default: -90,
    stable: -82,
    label: 15
  }
]
export const yearList = [
  {
    name: '2020-2021'
  },
  {
    name: '2021-2022'
  },
  {
    name: '2022-2023'
  },
  {
    name: '2023-2024'
  },
  {
    name: '2024-2025'
  },
  {
    name: '2025-2026'
  },
  {
    name: '2026-2027'
  },
  {
    name: '2027-2028'
  }
]
// 校历周数
export const weekList = [
  {id: 1, name: '第1周'},
  {id: 2, name: '第2周'},
  {id: 3, name: '第3周'},
  {id: 4, name: '第4周'},
  {id: 5, name: '第5周'},
  {id: 6, name: '第6周'},
  {id: 7, name: '第7周'},
  {id: 8, name: '第8周'},
  {id: 9, name: '第9周'},
  {id: 10, name: '第10周'},
  {id: 11, name: '第11周'},
  {id: 12, name: '第12周'},
  {id: 13, name: '第13周'},
  {id: 14, name: '第14周'},
  {id: 15, name: '第15周'},
  {id: 16, name: '第16周'},
  {id: 17, name: '第17周'},
  {id: 18, name: '第18周'},
  {id: 19, name: '第19周'},
  {id: 20, name: '第20周'},
  {id: 21, name: '第21周'},
  {id: 22, name: '第22周'},
  {id: 23, name: '第23周'},
  {id: 24, name: '第24周'},
  {id: 25, name: '第25周'}
]
// 个人中心
export const usercenter = {
  book: '/bookMylist', // 我的图书
  materiel: '/materielmylist', // 我的物料
  teaching: '/teachingMylist', // 我的教具
  task: '/task', // 任务管理
  questionmylist: '/questionTeachermylist', // 我的问卷
  Cornerline: '/Cornerline', // 实时区角
  doc: '/doc', // 文档管理
  mapIndex: '/3dmapIndex', // 3D校园地图
  NoticeList: '/NoticeList', // 电子通知
  questionnaireList: '/questionnaireList', // 调查问卷
  vote: '/vote', // 投票
  forum: '/forum', // 论坛
  addtask: '/addtask', // 发布任务
  NoticeDetail: '/NoticeDetail', // 发布通知
  questionnaireDetail: '/questionnaireDetail', // 发布通知
  applybook: '/applybook', // 申请图书
  studentExcel: '/studentExcel', // 导入学生
  applyMateriel: '/applyMateriel', // 申请物料
  applyteaching: '/applyteaching', // 申请教具
  Corner: '/Corner', // 预约区角
  Comment: '/Comment', // 点评餐品
  forumexamine: '/forumexamine', // 论坛审核
  noticelistexamine: '/noticelistexamine', // 电子通知审核
  questionnaireexamine: '/questionnaireexamine', // 问卷审核
  bookBorrow: '/bookBorrow', // 图书申请审核
  materielLending: '/materielLending', // 物料申请审核
  getlist: '/getlist', // 教具申请审核
  evaluateIndex: '/evaluateIndex'// 发育报告
}
// 我的焦点
export const myFouces = {
  studentIndex: '/studentIndex', // 在册学生
  tearchIndex: '/tearchIndex', // 在册职工
  CornerIndex: '/CornerIndex', // 区角
  foodList: '/foodList', // 餐品
  evaluateIndex: '/evaluateIndex', // 晨检
  book: '/book', // 在册图书
  materiel: '/materiel', // 物料
  teaching: '/teaching' // 教具
}

// 时间秒日期
export function yeartime(date) {
  let date_ = new Date(parseInt(date) * 1000)
  let year = date_.getFullYear()
  let month = date_.getMonth() + 1
  let day = date_.getDate()
  let hour = date_.getHours()
  let minute = date_.getMinutes()
  let second = date_.getSeconds()
  month = month < 10 ? ('0' + month) : month
  day = day < 10 ? ('0' + day) : day
  hour = hour < 10 ? ('0' + hour) : hour
  minute = minute < 10 ? ('0' + minute) : minute
  return year + '-' + month + '-' + day + ' ' + hour + ':' + minute
}

// 日期
export function yearDay(date) {
  let date_ = parseInt(date) ? new Date(parseInt(date) * 1000) : date
  let year = date_.getFullYear()
  let month = date_.getMonth() + 1
  let day = date_.getDate()
  month = month < 10 ? ('0' + month) : month
  day = day < 10 ? ('0' + day) : day
  return year + '-' + month + '-' + day
}

// 日期
export function hourTime(value) {
  console.log('data:', value)
  let theTime = parseInt(value)// 需要转换的时间秒
  let theTime1 = 0// 分
  let theTime2 = 0// 小时
  let theTime3 = 0// 天
  if (theTime > 60) {
    theTime1 = parseInt(theTime / 60)
    theTime = parseInt(theTime % 60)
    if (theTime1 > 60) {
      theTime2 = parseInt(theTime1 / 60)
      theTime1 = parseInt(theTime1 % 60)
      if (theTime2 > 24) {
        // 大于24小时
        theTime3 = parseInt(theTime2 / 24)
        theTime2 = parseInt(theTime2 % 24)
      }
    }
  }
  let result = ''
  if (theTime > 0) {
    result = '' + parseInt(theTime) + '秒'
  }
  if (theTime1 > 0) {
    result = '' + parseInt(theTime1) + '分' + result
  }
  if (theTime2 > 0) {
    result = '' + parseInt(theTime2) + '小时' + result
  }
  if (theTime3 > 0) {
    result = '' + parseInt(theTime3) + '天' + result
  }
  return result
}

// 日期
export function yearDayLine(date) {
  let year = date.getFullYear()
  let month = date.getMonth() + 1
  let day = date.getDate()
  month = month < 10 ? ('0' + month) : month
  day = day < 10 ? ('0' + day) : day

  return year + '-' + month + '-' + day
}

// 判断日期是否大于今天
export function dayCheck(date) {
  // 获取的时间格式为  2012-5-28 23:59:00
  let data_ = date + ' 23:59:59'
  let d = new Date(Date.parse(data_.replace(/-/g, '/')))
  let curDate = new Date()
  let state = true
  if (d >= curDate) {
    console.log('未过期！')
  } else {
    console.log('已过期！')
    state = false
  }

  return state
}

export const fileType = {
  excel: ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/vnd.ms-excel']
}
